﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Modal/Master/Form.Master" AutoEventWireup="true" CodeBehind="EditEntrust.aspx.cs" Inherits="Thksoft.Modal.EditEntrust" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="/Scripts/jquery-1.7.min.js" type="text/javascript"></script>
    <script src="/UserCotrols/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            var FORM_PRINCIPAL = "<%=FORM_PRINCIPAL.ClientID %>";
            var HIDE_FORM_PRINCIPAL = "<%=HIDE_FORM_PRINCIPAL.ClientID %>";
            var FORM_USER_ID = "<%=FORM_USER_ID.ClientID %>";
            var HIDE_FORM_USER_ID = "<%=HIDE_FORM_USER_ID.ClientID %>";
            $("#" + FORM_PRINCIPAL).click(function () {
                OpenUser(function (data) {
                    $("#" + FORM_PRINCIPAL).val(data.Text);
                    $("#" + HIDE_FORM_PRINCIPAL).val(data.Value);
                });
            });
            $("#" + FORM_USER_ID).click(function () {
                OpenUser(function (data) {
                    $("#" + FORM_USER_ID).val(data.Text);
                    $("#" + HIDE_FORM_USER_ID).val(data.Value);
                });
            });
        });
        function OpenUser(callback) {

            var option = {};
            option.Window = window;
            option.Value = "?mode=1";
            option.CallBack = function (index) {
                try {
                    var data = top.window.frames["layui-layer-iframe" + index].ModalData;
                    if (data.Text != "") {
                        callback(data);
                        //top.$(dom).attr("data-value", data.Value);
                        //top.$(dom).val(data.Text);
                        //alert(top.$(dom).attr("data-value"));
                    }
                    return true;
                } catch (e) {
                    top.MessageBox.Alert("选择用户回调错误");
                    return false;
                }
            }
            top.MessageBox.OpenUser(option);
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="server">
    <tr>
        <td align="right" style="width: 40%;">委托人：
        </td>
        <td align="left" style="padding-left: 10px;">
            <input id="FORM_PRINCIPAL" type="text" class="txt_input" runat="server" placeholder="单击请选择" />
            <asp:HiddenField runat="server" ID="HIDE_FORM_PRINCIPAL" />
        </td>
    </tr>
    <tr>
        <td align="right" style="width: 40%;">被委托人：
        </td>
        <td align="left" style="padding-left: 10px;">
            <input id="FORM_USER_ID" type="text" class="txt_input" runat="server" placeholder="单击请选择" />
            <asp:HiddenField runat="server" ID="HIDE_FORM_USER_ID" />
        </td>
    </tr>
    <tr>
        <td align="right" style="width: 40%;">开始时间：
        </td>
        <td align="left" style="padding-left: 10px;">
            <input id="FORM_BEGIN_DATE" runat="server" type="text" class="txt_input" placeholder="单击请选择" onclick="WdatePicker({readOnly:true})" />
        </td>
    </tr>
    <tr>
        <td align="right" style="width: 40%;">结束时间：
        </td>
        <td align="left" style="padding-left: 10px;">
            <input id="FORM_OVER_DATE" runat="server" type="text" class="txt_input" placeholder="单击请选择" onclick="WdatePicker({readOnly:true})" />
        </td>
    </tr>
    <tr>
        <td align="right" style="width: 40%;">委托状态：
        </td>
        <td align="left" style="padding-left: 10px;">
            <asp:DropDownList runat="server" ID="FORM_STATE">
                <asp:ListItem Text="是" Value="0" Selected="True"></asp:ListItem>
                <asp:ListItem Text="否" Value="1"></asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td align="right" style="width: 40%;">备注：
        </td>
        <td align="left" style="padding-left: 10px;">
            <textarea cols="30" rows="3" runat="server" id="FORM_REMARK">
            </textarea>
        </td>
    </tr>
    <tr runat="server" id="Div">
        <td align="right" style="width: 40%;">操作时间：
        </td>
        <td align="left" style="padding-left: 10px;">
            <label runat="server" id="D_NTRUST_OPERATING_TIME"></label>
        </td>
    </tr>
    <tr>
        <td align="right" style="width: 40%;">公司：
        </td>
        <td align="left" style="padding-left: 10px;">
            <uc2:CtrlCompany ID="FORM_COMPANY" runat="server" />
        </td>
    </tr>
</asp:Content>